home *** CD-ROM | disk | FTP | other *** search
/ Multimedia Jumpstart / Multimedia Microsoft Jumpstart Version 1.1a (Microsoft).BIN / develpmt / sdk / vfw11.win / vfwdk / compman.h_ / compman.bin
Encoding:
Text File  |  1993-11-19  |  19.5 KB  |  562 lines

  1. /*
  2. *  Header file for comunication with AVI installable compressors/decompressors
  3. *
  4. *  Copyright (c) 1990-1993, Microsoft Corp.  All rights reserved.
  5. *
  6. * Win16:
  7. *
  8. * Installable compressors should be listed in SYSTEM.INI as
  9. * follows:
  10. *
  11. * [Drivers]
  12. *      VIDC.MSSQ = mssqcomp.drv
  13. *      VIDC.XXXX = foodrv.drv
  14. *
  15. * Win32: (NT)
  16. *
  17. * Installable compressors should be listed in the registration database
  18. * under the key
  19. *   HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32
  20. *      VIDC.MSSQ = mssqcomp.dll
  21. *      VIDC.XXXX = foodrv.dll
  22. *
  23. *
  24. * That is, an identifying FOURCC should be the key, and the value
  25. * should be the driver filename
  26. *
  27. */
  28.  
  29. #ifndef _INC_COMPMAN
  30. #define _INC_COMPMAN
  31.  
  32. #ifndef VFWAPI
  33. #ifdef WIN32
  34.     #define VFWAPI  __stdcall
  35.     #define VFWAPIV __cdecl
  36. #else
  37.     #define VFWAPI  FAR PASCAL
  38.     #define VFWAPIV FAR CDECL
  39. #endif
  40. #endif
  41.  
  42. #ifdef __cplusplus
  43. extern "C" {            /* Assume C declarations for C++ */
  44. #endif  /* __cplusplus */
  45.  
  46. /************************************************************************
  47.  
  48.     messages and structures.
  49.  
  50. ************************************************************************/
  51.  
  52. #ifndef HTASK
  53.   #define HTASK HANDLE
  54. #endif
  55.  
  56. #include <compddk.h>            // include this file for the messages.
  57.  
  58. /************************************************************************
  59.  
  60.     ICM function declarations
  61.     
  62. ************************************************************************/
  63.  
  64. BOOL    VFWAPI ICInfo(DWORD fccType, DWORD fccHandler, ICINFO FAR * lpicinfo);
  65. BOOL    VFWAPI ICInstall(DWORD fccType, DWORD fccHandler, LPARAM lParam, LPSTR szDesc, UINT wFlags);
  66. BOOL    VFWAPI ICRemove(DWORD fccType, DWORD fccHandler, UINT wFlags);
  67. LRESULT VFWAPI ICGetInfo(HIC hic, ICINFO FAR *picinfo, DWORD cb);
  68.  
  69. HIC     VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode);
  70. HIC     VFWAPI ICOpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode, FARPROC lpfnHandler);
  71. LRESULT VFWAPI ICClose(HANDLE hic);
  72.  
  73. LRESULT VFWAPI  ICSendMessage(HIC hic, UINT msg, DWORD dw1, DWORD dw2);
  74. LRESULT VFWAPIV ICMessage(HIC hic, UINT msg, UINT cb, ...);
  75.  
  76. #if 0  // Defined in COMPMAN.C
  77. #ifdef WIN32
  78. //
  79. // note NT 1.0 MSVFW32.DLL does not have this function, so fake it
  80. // with this stupid function that will not work except on i386..
  81. //
  82. static LRESULT VFWAPIV ICMessage(HIC hic, UINT msg, UINT cb, ...)
  83. {
  84.     return ICSendMessage(hic, msg, (DWORD)(LPVOID)(&cb+1), cb);
  85. }
  86. #endif
  87. #endif
  88.  
  89. /* Values for wFlags of ICInstall() */
  90. #define ICINSTALL_FUNCTION      0x0001  // lParam is a DriverProc (function ptr)
  91. #define ICINSTALL_DRIVER        0x0002  // lParam is a driver name (string)
  92. #define ICINSTALL_HDRV          0x0004  // lParam is a HDRVR (driver handle)
  93.  
  94. /************************************************************************
  95.  
  96.     query macros
  97.  
  98. ************************************************************************/
  99. #define ICMF_CONFIGURE_QUERY     0x00000001
  100. #define ICMF_ABOUT_QUERY         0x00000001
  101.  
  102. #define ICQueryAbout(hic) \
  103.     (ICSendMessage(hic, ICM_ABOUT, (DWORD) -1, ICMF_ABOUT_QUERY) == ICERR_OK)
  104.  
  105. #define ICAbout(hic, hwnd) \
  106.     ICSendMessage(hic, ICM_ABOUT, (DWORD)(UINT)(hwnd), 0)
  107.  
  108. #define ICQueryConfigure(hic) \
  109.     (ICSendMessage(hic, ICM_CONFIGURE, (DWORD) -1, ICMF_CONFIGURE_QUERY) == ICERR_OK)
  110.  
  111. #define ICConfigure(hic, hwnd) \
  112.     ICSendMessage(hic, ICM_CONFIGURE, (DWORD)(UINT)(hwnd), 0)
  113.  
  114. /************************************************************************
  115.  
  116.     get/set state macros
  117.     
  118. ************************************************************************/
  119.  
  120. #define ICGetState(hic, pv, cb) \
  121.     ICSendMessage(hic, ICM_GETSTATE, (DWORD)(LPVOID)(pv), (DWORD)(cb))
  122.  
  123. #define ICSetState(hic, pv, cb) \
  124.     ICSendMessage(hic, ICM_SETSTATE, (DWORD)(LPVOID)(pv), (DWORD)(cb))
  125.  
  126. #define ICGetStateSize(hic) \
  127.     ICGetState(hic, NULL, 0)
  128.  
  129. /************************************************************************
  130.  
  131.     get value macros
  132.  
  133. ************************************************************************/
  134. static DWORD dwICValue;
  135.  
  136. #define ICGetDefaultQuality(hic) \
  137.     (ICSendMessage(hic, ICM_GETDEFAULTQUALITY, (DWORD)(LPVOID)&dwICValue, sizeof(DWORD)), dwICValue)
  138.  
  139. #define ICGetDefaultKeyFrameRate(hic) \
  140.     (ICSendMessage(hic, ICM_GETDEFAULTKEYFRAMERATE, (DWORD)(LPVOID)&dwICValue, sizeof(DWORD)), dwICValue)
  141.  
  142. /************************************************************************
  143.  
  144.     draw window macro
  145.     
  146. ************************************************************************/
  147. #define ICDrawWindow(hic, prc) \
  148.     ICSendMessage(hic, ICM_DRAW_WINDOW, (DWORD)(LPVOID)(prc), sizeof(RECT))
  149.  
  150. /************************************************************************
  151.  
  152.     compression functions
  153.  
  154. ************************************************************************/
  155. /*
  156.  *  ICCompress()
  157.  *
  158.  *  compress a single frame
  159.  *
  160.  */
  161. DWORD VFWAPIV ICCompress(
  162.     HIC                 hic,
  163.     DWORD               dwFlags,        // flags
  164.     LPBITMAPINFOHEADER  lpbiOutput,     // output format
  165.     LPVOID              lpData,         // output data
  166.     LPBITMAPINFOHEADER  lpbiInput,      // format of frame to compress
  167.     LPVOID              lpBits,         // frame data to compress
  168.     LPDWORD             lpckid,         // ckid for data in AVI file
  169.     LPDWORD             lpdwFlags,      // flags in the AVI index.
  170.     LONG                lFrameNum,      // frame number of seq.
  171.     DWORD               dwFrameSize,    // reqested size in bytes. (if non zero)
  172.     DWORD               dwQuality,      // quality within one frame
  173.     LPBITMAPINFOHEADER  lpbiPrev,       // format of previous frame
  174.     LPVOID              lpPrev);        // previous frame
  175.  
  176. /*
  177.  *  ICCompressBegin()
  178.  *
  179.  *  start compression from a source format (lpbiInput) to a dest
  180.  *  format (lpbiOuput) is supported.
  181.  *
  182.  */
  183. #define ICCompressBegin(hic, lpbiInput, lpbiOutput) \
  184.     ICSendMessage(hic, ICM_COMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput), (DWORD)(LPVOID)(lpbiOutput))
  185.  
  186. /*
  187.  *  ICCompressQuery()
  188.  *
  189.  *  determines if compression from a source format (lpbiInput) to a dest
  190.  *  format (lpbiOuput) is supported.
  191.  *
  192.  */
  193. #define ICCompressQuery(hic, lpbiInput, lpbiOutput) \
  194.     ICSendMessage(hic, ICM_COMPRESS_QUERY, (DWORD)(LPVOID)(lpbiInput), (DWORD)(LPVOID)(lpbiOutput))
  195.  
  196. /*
  197.  *  ICCompressGetFormat()
  198.  *
  199.  *  get the ouput format, (format of compressed data)
  200.  *  if lpbiOuput is NULL return the size in bytes needed for format.
  201.  *
  202.  */
  203. #define ICCompressGetFormat(hic, lpbiInput, lpbiOutput) \
  204.     ICSendMessage(hic, ICM_COMPRESS_GET_FORMAT, (DWORD)(LPVOID)(lpbiInput), (DWORD)(LPVOID)(lpbiOutput))
  205.  
  206. #define ICCompressGetFormatSize(hic, lpbi) \
  207.     ICCompressGetFormat(hic, lpbi, NULL)
  208.  
  209. /*
  210.  *  ICCompressSize()
  211.  *
  212.  *  return the maximal size of a compressed frame
  213.  *
  214.  */
  215. #define ICCompressGetSize(hic, lpbiInput, lpbiOutput) \
  216.     ICSendMessage(hic, ICM_COMPRESS_GET_SIZE, (DWORD)(LPVOID)(lpbiInput), (DWORD)(LPVOID)(lpbiOutput))
  217.  
  218. #define ICCompressEnd(hic) \
  219.     ICSendMessage(hic, ICM_COMPRESS_END, 0, 0)
  220.  
  221. /************************************************************************
  222.  
  223.     decompression functions
  224.  
  225. ************************************************************************/
  226.  
  227. /*
  228.  *  ICDecompress()
  229.  *
  230.  *  decompress a single frame
  231.  *
  232.  */
  233. #define ICDECOMPRESS_HURRYUP    0x80000000L     // don't draw just buffer (hurry up!)
  234.  
  235. DWORD VFWAPIV ICDecompress(
  236.     HIC                 hic,
  237.     DWORD               dwFlags,    // flags (from AVI index...)
  238.     LPBITMAPINFOHEADER  lpbiFormat, // BITMAPINFO of compressed data
  239.                                     // biSizeImage has the chunk size
  240.     LPVOID              lpData,     // data
  241.     LPBITMAPINFOHEADER  lpbi,       // DIB to decompress to
  242.     LPVOID              lpBits);
  243.  
  244. /*
  245.  *  ICDecompressBegin()
  246.  *
  247.  *  start compression from a source format (lpbiInput) to a dest
  248.  *  format (lpbiOuput) is supported.
  249.  *
  250.  */
  251. #define ICDecompressBegin(hic, lpbiInput, lpbiOutput) \
  252.     ICSendMessage(hic, ICM_DECOMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput), (DWORD)(LPVOID)(lpbiOutput))
  253.  
  254. /*
  255.  *  ICDecompressQuery()
  256.  *
  257.  *  determines if compression from a source format (lpbiInput) to a dest
  258.  *  format (lpbiOuput) is supported.
  259.  *
  260.  */
  261. #define ICDecompressQuery(hic, lpbiInput, lpbiOutput) \
  262.     ICSendMessage(hic, ICM_DECOMPRESS_QUERY, (DWORD)(LPVOID)(lpbiInput), (DWORD)(LPVOID)(lpbiOutput))
  263.  
  264. /*
  265.  *  ICDecompressGetFormat()
  266.  *
  267.  *  get the ouput format, (format of un-compressed data)
  268.  *  if lpbiOuput is NULL return the size in bytes needed for format.
  269.  *
  270.  */
  271. #define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput) \
  272.     ((LONG) ICSendMessage(hic, ICM_DECOMPRESS_GET_FORMAT, (DWORD)(LPVOID)(lpbiInput), (DWORD)(LPVOID)(lpbiOutput)))
  273.  
  274. #define ICDecompressGetFormatSize(hic, lpbi) \
  275.     ICDecompressGetFormat(hic, lpbi, NULL)
  276.  
  277. /*
  278.  *  ICDecompressGetPalette()
  279.  *
  280.  *  get the ouput palette
  281.  *
  282.  */
  283. #define ICDecompressGetPalette(hic, lpbiInput, lpbiOutput) \
  284.     ICSendMessage(hic, ICM_DECOMPRESS_GET_PALETTE, (DWORD)(LPVOID)(lpbiInput), (DWORD)(LPVOID)(lpbiOutput))
  285.  
  286. #define ICDecompressEnd(hic) \
  287.     ICSendMessage(hic, ICM_DECOMPRESS_END, 0, 0)
  288.  
  289. /************************************************************************
  290.  
  291.     decompression (ex) functions
  292.  
  293. ************************************************************************/
  294.  
  295. /*
  296.  *  ICDecompressEx()
  297.  *
  298.  *  decompress a single frame
  299.  *
  300.  */
  301. #define ICDecompressEx(hic, dwFlags, lpbiSrc, lpSrc, xSrc, ySrc, dxSrc, dySrc, lpbiDst, lpDst, xDst, yDst, dxDst, dyDst) \
  302.     ICMessage(hic, ICM_DECOMPRESSEX, sizeof(ICDECOMPRESSEX), \
  303.         (DWORD)(dwFlags), \
  304.         (LPBITMAPINFOHEADER)(lpbiSrc), (LPVOID)(lpSrc), \
  305.         (LPBITMAPINFOHEADER)(lpbiDst), (LPVOID)(lpDst), \
  306.         (int)(xDst), (int)(yDst), (int)(dxDst), (int)(dyDst), \
  307.         (int)(xSrc), (int)(ySrc), (int)(dxSrc), (int)(dySrc))
  308.  
  309. /*
  310.  *  ICDecompressBegin()
  311.  *
  312.  *  start compression from a source format (lpbiInput) to a dest
  313.  *  format (lpbiOuput) is supported.
  314.  *
  315.  */
  316. #define ICDecompressExBegin(hic, dwFlags, lpbiSrc, lpSrc, xSrc, ySrc, dxSrc, dySrc, lpbiDst, lpDst, xDst, yDst, dxDst, dyDst) \
  317.     ICMessage(hic, ICM_DECOMPRESSEX_BEGIN, sizeof(ICDECOMPRESSEX), \
  318.         (DWORD)(dwFlags), \
  319.         (LPBITMAPINFOHEADER)(lpbiSrc), (LPVOID)(lpSrc), \
  320.         (LPBITMAPINFOHEADER)(lpbiDst), (LPVOID)(lpDst), \
  321.         (int)(xDst), (int)(yDst), (int)(dxDst), (int)(dyDst), \
  322.         (int)(xSrc), (int)(ySrc), (int)(dxSrc), (int)(dySrc))
  323.  
  324. /*
  325.  *  ICDecompressExQuery()
  326.  *
  327.  */
  328. #define ICDecompressExQuery(hic, dwFlags, lpbiSrc, lpSrc, xSrc, ySrc, dxSrc, dySrc, lpbiDst, lpDst, xDst, yDst, dxDst, dyDst) \
  329.     ICMessage(hic, ICM_DECOMPRESSEX_QUERY,  sizeof(ICDECOMPRESSEX), \
  330.         (DWORD)(dwFlags), \
  331.         (LPBITMAPINFOHEADER)(lpbiSrc), (LPVOID)(lpSrc), \
  332.         (LPBITMAPINFOHEADER)(lpbiDst), (LPVOID)(lpDst), \
  333.         (int)(xDst), (int)(yDst), (int)(dxDst), (int)(dyDst), \
  334.         (int)(xSrc), (int)(ySrc), (int)(dxSrc), (int)(dySrc))
  335.  
  336. #define ICDecompressExEnd(hic) \
  337.     ICSendMessage(hic, ICM_DECOMPRESSEX_END, 0, 0)
  338.  
  339. /************************************************************************
  340.  
  341.     drawing functions
  342.  
  343. ************************************************************************/
  344.  
  345. /*
  346.  *  ICDrawBegin()
  347.  *
  348.  *  start decompressing data with format (lpbiInput) directly to the screen
  349.  *
  350.  *  return zero if the decompressor supports drawing.
  351.  *
  352.  */
  353.  
  354. #define ICDRAW_QUERY        0x00000001L   // test for support
  355. #define ICDRAW_FULLSCREEN   0x00000002L   // draw to full screen
  356. #define ICDRAW_HDC          0x00000004L   // draw to a HDC/HWND
  357.  
  358. DWORD VFWAPIV ICDrawBegin(
  359.         HIC                 hic,
  360.         DWORD               dwFlags,        // flags
  361.         HPALETTE            hpal,           // palette to draw with
  362.         HWND                hwnd,           // window to draw to
  363.         HDC                 hdc,            // HDC to draw to
  364.         int                 xDst,           // destination rectangle
  365.         int                 yDst,
  366.         int                 dxDst,
  367.         int                 dyDst,
  368.         LPBITMAPINFOHEADER  lpbi,           // format of frame to draw
  369.         int                 xSrc,           // source rectangle
  370.         int                 ySrc,
  371.         int                 dxSrc,
  372.         int                 dySrc,
  373.         DWORD               dwRate,         // frames/second = (dwRate/dwScale)
  374.         DWORD               dwScale);
  375.  
  376. /*
  377.  *  ICDraw()
  378.  *
  379.  *  decompress data directly to the screen
  380.  *
  381.  */
  382.  
  383. #define ICDRAW_HURRYUP      0x80000000L   // don't draw just buffer (hurry up!)
  384. #define ICDRAW_UPDATE       0x40000000L   // don't draw just update screen
  385.  
  386. DWORD VFWAPIV ICDraw(
  387.         HIC                 hic,
  388.         DWORD               dwFlags,        // flags
  389.         LPVOID            lpFormat,       // format of frame to decompress
  390.         LPVOID              lpData,         // frame data to decompress
  391.         DWORD               cbData,         // size of data
  392.         LONG                lTime);         // time to draw this frame
  393.  
  394. #define ICDrawSuggestFormat(hic,lpbiIn,lpbiOut,dxSrc,dySrc,dxDst,dyDst,hicDecomp) \
  395.         ICMessage(hic, ICM_DRAW_SUGGESTFORMAT, sizeof(ICDRAWSUGGEST),   \
  396.             (LPBITMAPINFOHEADER)(lpbiIn),(LPBITMAPINFOHEADER)(lpbiOut), \
  397.             (int)(dxSrc),(int)(dySrc),(int)(dxDst),(int)(dyDst), (HIC)(hicDecomp))
  398.  
  399. /*
  400.  *  ICDrawQuery()
  401.  *
  402.  *  determines if the compressor is willing to render the specified format.
  403.  *
  404.  */
  405. #define ICDrawQuery(hic, lpbiInput) \
  406.     ICSendMessage(hic, ICM_DRAW_QUERY, (DWORD)(LPVOID)(lpbiInput), 0L)
  407.  
  408. #define ICDrawChangePalette(hic, lpbiInput) \
  409.     ICSendMessage(hic, ICM_DRAW_CHANGEPALETTE, (DWORD)(LPVOID)(lpbiInput), 0L)
  410.  
  411. #define ICGetBuffersWanted(hic, lpdwBuffers) \
  412.     ICSendMessage(hic, ICM_GETBUFFERSWANTED, (DWORD)(LPVOID)(lpdwBuffers), 0)
  413.  
  414. #define ICDrawEnd(hic) \
  415.     ICSendMessage(hic, ICM_DRAW_END, 0, 0)
  416.  
  417. #define ICDrawStart(hic) \
  418.     ICSendMessage(hic, ICM_DRAW_START, 0, 0)
  419.  
  420. #define ICDrawStartPlay(hic, lFrom, lTo) \
  421.     ICSendMessage(hic, ICM_DRAW_START_PLAY, (DWORD)(lFrom), (DWORD)(lTo))
  422.  
  423. #define ICDrawStop(hic) \
  424.     ICSendMessage(hic, ICM_DRAW_STOP, 0, 0)
  425.  
  426. #define ICDrawStopPlay(hic) \
  427.     ICSendMessage(hic, ICM_DRAW_STOP_PLAY, 0, 0)
  428.  
  429. #define ICDrawGetTime(hic, lplTime) \
  430.     ICSendMessage(hic, ICM_DRAW_GETTIME, (DWORD)(LPVOID)(lplTime), 0)
  431.  
  432. #define ICDrawSetTime(hic, lTime) \
  433.     ICSendMessage(hic, ICM_DRAW_SETTIME, (DWORD)lTime, 0)
  434.  
  435. #define ICDrawRealize(hic, hdc, fBackground) \
  436.     ICSendMessage(hic, ICM_DRAW_REALIZE, (DWORD)(UINT)(HDC)(hdc), (DWORD)(BOOL)(fBackground))
  437.  
  438. #define ICDrawFlush(hic) \
  439.     ICSendMessage(hic, ICM_DRAW_FLUSH, 0, 0)
  440.  
  441. #define ICDrawRenderBuffer(hic) \
  442.     ICSendMessage(hic, ICM_DRAW_RENDERBUFFER, 0, 0)
  443.  
  444. /************************************************************************
  445.  
  446.     Status callback functions
  447.  
  448. ************************************************************************/
  449.  
  450. /*
  451.  *  ICSetStatusProc()
  452.  *
  453.  *  Set the status callback function
  454.  *
  455.  */
  456. #define ICSetStatusProc(hic, dwFlags, lParam, fpfnStatus) \
  457.     ICMessage(hic, ICM_SET_STATUS_PROC, sizeof(ICSETSTATUSPROC), \
  458.         (DWORD)(dwFlags), \
  459.     (LRESULT)(lParam), \
  460.     (LONG ((CALLBACK *) ()))(fpfnStatus))
  461.  
  462. /************************************************************************
  463.  
  464. helper routines for DrawDib and MCIAVI...
  465.  
  466. ************************************************************************/
  467.  
  468. #define ICDecompressOpen(fccType, fccHandler, lpbiIn, lpbiOut) \
  469.     ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, ICMODE_DECOMPRESS)
  470.  
  471. #define ICDrawOpen(fccType, fccHandler, lpbiIn) \
  472.     ICLocate(fccType, fccHandler, lpbiIn, NULL, ICMODE_DRAW)
  473.  
  474. HIC  VFWAPI ICLocate(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, WORD wFlags);
  475. HIC  VFWAPI ICGetDisplayFormat(HIC hic, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, int BitDepth, int dx, int dy);
  476.  
  477. /************************************************************************
  478. Higher level functions
  479. ************************************************************************/
  480.  
  481. HANDLE VFWAPI ICImageCompress(
  482.         HIC                 hic,        // compressor to use
  483.         UINT                uiFlags,    // flags (none yet)
  484.         LPBITMAPINFO        lpbiIn,     // format to compress from
  485.         LPVOID              lpBits,     // data to compress
  486.         LPBITMAPINFO        lpbiOut,    // compress to this (NULL ==> default)
  487.         LONG                lQuality,   // quality to use
  488.         LONG FAR *          plSize);     // compress to this size (0=whatever)
  489.  
  490. HANDLE VFWAPI ICImageDecompress(
  491.         HIC                 hic,        // compressor to use
  492.         UINT                uiFlags,    // flags (none yet)
  493.         LPBITMAPINFO        lpbiIn,     // format to decompress from
  494.         LPVOID              lpBits,     // data to decompress
  495.         LPBITMAPINFO        lpbiOut);   // decompress to this (NULL ==> default)
  496.  
  497. //
  498. // Structure used by ICSeqCompressFrame and ICCompressorChoose routines
  499. // Make sure this matches the autodoc in icm.c!
  500. //
  501. typedef struct {
  502.     LONG        cbSize;        // set to sizeof(COMPVARS) before
  503.                     // calling ICCompressorChoose
  504.     DWORD        dwFlags;    // see below...
  505.     HIC            hic;        // HIC of chosen compressor
  506.     DWORD               fccType;    // basically ICTYPE_VIDEO
  507.     DWORD               fccHandler;    // handler of chosen compressor or
  508.                     // "" or "DIB "
  509.     LPBITMAPINFO    lpbiIn;        // input format
  510.     LPBITMAPINFO    lpbiOut;    // output format - will compress to this
  511.     LPVOID        lpBitsOut;
  512.     LPVOID        lpBitsPrev;
  513.     LONG        lFrame;
  514.     LONG        lKey;        // key frames how often?
  515.     LONG        lDataRate;    // desired data rate KB/Sec
  516.     LONG        lQ;        // desired quality
  517.     LONG        lKeyCount;
  518.     LPVOID        lpState;    // state of compressor
  519.     LONG        cbState;    // size of the state
  520. } COMPVARS, FAR *PCOMPVARS;
  521.  
  522. // FLAGS for dwFlags element of COMPVARS structure:
  523. // set this flag if you initialize COMPVARS before calling ICCompressorChoose
  524. #define ICMF_COMPVARS_VALID    0x00000001    // COMPVARS contains valid data
  525.  
  526. //
  527. //  allows user to choose compressor, quality etc...
  528. //
  529. BOOL VFWAPI ICCompressorChoose(
  530.         HWND        hwnd,               // parent window for dialog
  531.         UINT        uiFlags,            // flags
  532.         LPVOID      pvIn,               // input format (optional)
  533.         LPVOID      lpData,             // input data (optional)
  534.         PCOMPVARS   pc,                 // data about the compressor/dlg
  535.         LPSTR       lpszTitle);         // dialog title (optional)
  536.  
  537. // defines for uiFlags
  538. #define ICMF_CHOOSE_KEYFRAME    0x0001    // show KeyFrame Every box
  539. #define ICMF_CHOOSE_DATARATE    0x0002    // show DataRate box
  540. #define ICMF_CHOOSE_PREVIEW    0x0004    // allow expanded preview dialog
  541. #define ICMF_CHOOSE_ALLCOMPRESSORS    0x0008    // don't only show those that
  542.                         // can handle the input format
  543.                         // or input data
  544.  
  545. BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn);
  546. void VFWAPI ICSeqCompressFrameEnd(PCOMPVARS pc);
  547.  
  548. LPVOID VFWAPI ICSeqCompressFrame(
  549.     PCOMPVARS               pc,         // set by ICCompressorChoose
  550.     UINT                    uiFlags,    // flags
  551.     LPVOID                  lpBits,     // input DIB bits
  552.     BOOL FAR             *pfKey,    // did it end up being a key frame?
  553.     LONG FAR            *plSize);    // size to compress to/of returned image
  554.  
  555. void VFWAPI ICCompressorFree(PCOMPVARS pc);
  556.  
  557. #ifdef __cplusplus
  558. }                       /* End of extern "C" { */
  559. #endif    /* __cplusplus */
  560.  
  561. #endif /* _INC_COMPMAN */
  562.